package com.smallyang.controller;

import com.smallyang.domain.ResponseResult;
import com.smallyang.domain.vo.BarVo;
import com.smallyang.domain.vo.PieVo;
import com.smallyang.service.ArticleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 杨森
 * @description:
 * @date 2023年05月24日 18:12
 */
@RestController
@RequestMapping("/chart/article")
public class BarArticleController {
    @Autowired
    private ArticleService articleService;

    @GetMapping("/getbar")
    public ResponseResult barVo(){
        BarVo article = articleService.barVoList();
        return ResponseResult.okResult(article);
    }

    @GetMapping("/getpie")
    public ResponseResult pieVo(){
        List<PieVo> article = articleService.pieVoList();
        return ResponseResult.okResult(article);
    }
}
